﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TimScripts.BF4Rcon
{
    public class RconPlayer : Player
    {
        private Dictionary<string, string> Properties;

        public RconPlayer(IDictionary<string, string> properties)
            : this()
        {
            Properties = new Dictionary<string, string>(properties, StringComparer.OrdinalIgnoreCase);
        }

        public override string this[string key]
        {
            get { return Properties[key]; }
        }

        public override bool TryGetProperty(string key, out string value)
        {
            return Properties.TryGetValue(key, out value);
        }

        public override bool ContainsProperty(string key)
        {
            return Properties.ContainsKey(key);
        }

        private RconPlayer()
        {
            AddAlias("team", "teamId");
            AddAlias("squad", "squadId");
        }
    }
}
